﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PTCapture.Support
{
    public static class TimeFunctions
    {
        /// <summary>
        /// Return a string of the time stamp.
        /// </summary>
        /// <returns></returns>
        public static string CurrentTimeStamp()
        {
            //string ts = DateTime.Now.ToString("ddMMyyyy_hhmmss");
            string ts = DateTime.Now.ToString("yyyyMMdd_hhmmss");

            return ts;
        }

        /// <summary>
        /// Return a string of the time stamp with maximum time being in minutes and least in milliseconds.
        /// </summary>
        /// <returns></returns>
        public static string ConvertMinute(TimeSpan ts)
        {
            //string ts = DateTime.Now.ToString("ddMMyyyy_hhmmss");
            string s = ts.ToString("mmssff");

            return s;
        }

        /// <summary>
        /// Return a string of the time stamp with maximum time being in hours and least in milliseconds.
        /// </summary>
        /// <returns></returns>
        public static string ConvertHour(TimeSpan ts)
        {
            //string ts = DateTime.Now.ToString("ddMMyyyy_hhmmss");
            string s = ts.ToString("hhmmssff");

            return s;
        }

        /// <summary>
        /// Return a string of the time stamp with maximum time being in years and least in seconds.
        /// </summary>
        /// <returns></returns>
        public static string ConvertYear(TimeSpan ts)
        {
            string s = ts.ToString("yyyyMMdd_hhmmss");

            return s;
        }
    }
}
